<?php
/**
 * Created by PhpStorm.
 * User: WhiteBlue
 * Date: 15/3/4
 * Time: 下午8:45
 */
use core\main\model;

class content extends model{

    //设置要匹配的表内容(后面的是成员变量名)
    protected function getRelationMap()
    {
        return array(
            'id'=> 'id',
            'pw'=>'pw'
        );
    }

    protected function getTableName()
    {
        return 'user';
    }


    //例子
    public function test1(){
        $test=new content();
        $test->setpw('password');
        $test->save();
    }

    public function test2(){
        $test=new content(1);
        $test->delete();
    }

    public function test3(){
        return $this->query('SELECT * FROM user;');
    }

}